import SdkTool from "../../../Core/Sdk/SdkTool";
import { RandomUtils } from "../../../Core/Utils/RandomUtils";
import ProtoBufManager from "../../proto/ProtoBufManager";
import { common } from "../../proto/protoCmd";
import { AbstractModel } from "../socket/AbstractModel";
import { ModelPlayerInfo } from "./ModelPlayerInfo";

export class ModelInfo extends AbstractModel {
    public playerInfo: ModelPlayerInfo = new ModelPlayerInfo();
    public myatkArray: string[] = [];
    public otheratkArray: string[] = [];
    public myscore: number = 0;
    public otherscore: number = 0;
    /**随机一个我的攻击点位 */
    public randommyAtk(): string {
        const ri = RandomUtils.ins.limitInteger(0, 9);
        const rj = RandomUtils.ins.limitInteger(0, 9);
        for (let i of this.myatkArray) {
            if (i == `${ri}-${rj}`) {
                return this.randommyAtk();
            }
        }
        return `${ri}-${rj}`;
    }
    public randomotherAtk(): string {
        const ri = RandomUtils.ins.limitInteger(0, 9);
        const rj = RandomUtils.ins.limitInteger(0, 9);
        for (let i of this.otheratkArray) {
            if (i == `${ri}-${rj}`) {
                return this.randomotherAtk();
            }
        }
        return `${ri}-${rj}`;
    }
}